package cn.itsource.ymcc.client;

import cn.itsource.result.JSONResult;
import cn.itsource.ymcc.doc.CourseDoc;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = SearchClientFallbackFactory.class)
public interface SearchClient {
    /**
     * 批量添加课程文档数据， - 课程服务通过openfeign来调用  课程上线
     * @param courseDocList
     * @return
     */
    @PostMapping("/search/saveBatch")
    JSONResult saveBatch(@RequestBody List<CourseDoc> courseDocList);

    /**
     * 通过id集合批量删除课程文档数据，-  课程服务通过openfeign来调用 课程下线
     * @param courseIds
     * @return
     */
    @DeleteMapping("/search/deleteBatch")
    JSONResult deleteBatch(@RequestBody List<Long> courseIds);

    /**
     * 传递courseIds数组 查询数据
     * @param courseIds
     * @return
     */
    @PostMapping("/search/getCourseInfo")
    JSONResult getCourseInfo(@RequestBody List<Long> courseIds);

}
